﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for FrameTest and is intended
    ///to contain all FrameTest Unit Tests
    ///</summary>
    [TestClass()]
    public class FrameTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Frame Constructor
        ///</summary>
        [TestMethod()]
        public void FrameConstructorTest() {
            Frame target = new Frame();
            Assert.AreEqual("<frame/>", target.ToString());
        }

        /// <summary>
        ///A test for FrameBorder
        ///</summary>
        [TestMethod()]
        public void FrameBorderTest() {
            Frame target = new Frame();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.FrameBorder = expected;
            actual = target.FrameBorder;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MarginHeight
        ///</summary>
        [TestMethod()]
        public void MarginHeightTest() {
            Frame target = new Frame();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.MarginHeight = expected;
            actual = target.MarginHeight;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MarginWidth
        ///</summary>
        [TestMethod()]
        public void MarginWidthTest() {
            Frame target = new Frame();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.MarginWidth = expected;
            actual = target.MarginWidth;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Frame target = new Frame();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for NoResize
        ///</summary>
        [TestMethod()]
        public void NoResizeTest() {
            Frame target = new Frame();
            bool expected = false;
            bool actual;
            target.NoResize = expected;
            actual = target.NoResize;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Scrollbar
        ///</summary>
        [TestMethod()]
        public void ScrollbarTest() {
            Frame target = new Frame();
            Nullable<bool> expected = false;
            Nullable<bool> actual;
            target.Scrollbar = expected;
            actual = target.Scrollbar;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Src
        ///</summary>
        [TestMethod()]
        public void SrcTest() {
            string expected = string.Empty;
            Frame target = new Frame(expected);
            string actual;
            target.Src = expected;
            actual = target.Src;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Frame f = new Frame("src", "name");
            f.FrameBorder = 1;
            f.MarginHeight = 2;
            f.MarginWidth = 3;
            f.NoResize = true;
            f.Scrollbar = false;
            Assert.AreEqual("<frame frameborder=\"1\" " +
                "marginheight=\"2\" " +
                "marginwidth=\"3\" " +
                "name=\"name\" " +
                "noresize=\"noresize\" " +
                "scrollbar=\"no\" " +
                "src=\"src\"/>", f.ToString());
        }
    }
}
